package com.bstech.Utils;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class Net {
	
	public static boolean InternetConnectionAvailable(Context context) {
		try {
			ConnectivityManager cm = (ConnectivityManager) context
					.getSystemService(Context.CONNECTIVITY_SERVICE);
			NetworkInfo netInfo = cm.getActiveNetworkInfo();
			if (netInfo != null
					&& (netInfo.isConnected() || netInfo
							.isConnectedOrConnecting())) {
				return true;
			}

			netInfo = null;
			cm = null;

			return false;

		} catch (Exception e) {
			return false;
		}
	}
}
